<template>
  <div class="dashboard-container">
   <h1 style="text-align: center">1903010316赖志勋</h1>
    <center><h3 ><font color="	#87CEEB">创建的学校数量有：{{sc}}  个</font>
      
    </h3>
    <h3><font color="	#87CEEB">创建的学院数量有：{{ac}}  个</font>
    </h3>
      <h3><font color="	#87CEEB">创建的班级数量有：{{cl}}  个</font>
    </h3>
     <h3><font color="	#87CEEB">创建的学生数量有：{{st}}  个</font>
    </h3>
    <h3><font color="	#87CEEB">创建的老师数量有：{{te}}  个</font>
    </h3>
    </center>
  </div>
</template>
<script>
  import { mapGetters } from 'vuex'

  export default {
    name: 'Dashboard',
    data(){
      return{
        sc:0,
        ac:0,
        cl:0,
        st:0,
        te:0,
      }
    },
    computed: {
      ...mapGetters([
        'name'
      ])
    },
    mounted(){
      this.$http.get('/api/users/add').then(res => {
        console.log('this.panels', res)
      })
       this.$http.post('/api/school/find').then(res => {
        if(res&&res.length>0){
          this.sc = res.length
          console.log('res:', res)
       this.$http.post('/api/academy/find').then(res => {
        if(res&&res.length>0){
          this.ac = res.length
          console.log('res:', res)
       this.$http.post('/api/classs/find').then(res => {
        if(res&&res.length>0){
          this.cl = res.length
          console.log('res:', res)
        this.$http.post('/api/student/find').then(res => {
        if(res&&res.length>0){
          this.st = res.length
          console.log('res:', res)
        this.$http.post('/api/teacher/find').then(res => {
        if(res&&res.length>0){
          this.te = res.length
          console.log('res:', res)
        }
      })
        }
      })
        }
      })
        }
      })
        }
      })
    }
  }</script>
<style lang="scss" scoped>
  .dashboard {
    &-container {
      margin: 30px;
    }
    &-text {
      font-size: 50px;
      line-height: 46px;
      color:blue($color: #0950e7)
    }
  }</style>